package com.realife.eson.common.util.common;

import org.springframework.context.ApplicationContext;

/**
 * @version V1.0
 * @author: guangcheng
 * @date: 2022/3/30 14:44
 * @description:
 */
public class SpringBeanUtil {
    private static ApplicationContext applicationContext;

    public SpringBeanUtil() {
    }

    public static void setApplicationContext(ApplicationContext context) {
        applicationContext = context;
    }

    public static Object getBean(String beanId) {
        return applicationContext.getBean(beanId);
    }

    public static Object getBean(Class clazz) {
        return applicationContext.getBean(clazz);
    }
}
